<?php if(isset($_SESSION['user']['user_id']) && $_SESSION['user']['user_id']!=""){?>
<div class="col-md-8">
<div class="main-content" id="main-content">
	<div class="sub-content">
		<div class="top-header products clearfix">
			<div class="pull-left pad">
				<h1>Users List</h1>
			</div>
		</div>
		<div class="product_table table-responsive">
			<table border="1" cellpadding="0" cellspacing="0" width="100%" id="search_results" class="table table-bordered table-hover">
			   <thead>
				<tr class="bg_header">
					<td>SNO</td>
					<td>CompanyName</td>
					<td >Status</td>
					<td>Email</td>
					<td>Action</td>
				</tr>
			   </thead>
			</table>
		</div>
	</div>
</div><div class="spacer20">&nbsp;</div>
<div class="spacer20">
	<a href="<? echo $this->Url('users')?>/allusers-list" id="continue" role="button" class="btn btn-danger">Back</a>
</div>
<input type="hidden" id="admin_user_id" name="admin_user_id" value="<? if(isset($_GET['user_id'])){ echo $_GET['user_id'];}?>"></div>
<script>
$(function(){
	var user_id=$("#admin_user_id").val();
	$.ajax({
		type:	'GET',
		dataType:'json',
		url: BASE_PATH+'/users/admin-users?user_id='+user_id,
		success: function(data){
		eval(data);
		var oTable = $('#search_results').dataTable( {
					aoColumnDefs: [{bSortable: false,
									aTargets: [ 0 ]
									}],
					"bStateSave": true,
					"bAutoWidth": true,
					"sRowSelect": "multi",
					"sPaginationType": "full_numbers",
					"bProcessing": true,
 					"aaData": data,
					"aoColumns": [
						{ "mData": "sno" },
						{ "mData": "companyname" },
						{ "mData": "status" },
						{ "mData": "email" },
						{ "mData": "action" }
					] 
				});			
		}
	});
});
</script>
<?php }else{?>
<script>
	window.location='<? echo $this->Url('home')?>';
</script>
<?php }?>